package com.blb.exam.student.controller;

import com.blb.exam.common.controller.BaseServlet;
import com.blb.exam.common.entity.QuetionSet;
import com.blb.exam.common.util.SpringUtils;
import com.blb.exam.student.service.QuetionSetService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/quetionSet.do")
public class QuetionSetServlet extends BaseServlet {

    private QuetionSetService quetionSetService = SpringUtils.getBean(QuetionSetService.class);

    public void findAll(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{
        List<QuetionSet> sets = quetionSetService.findAll();
        req.setAttribute("quetionSets", sets);
        req.getRequestDispatcher("quetionSet.jsp").forward(req,resp);
    }
}
